<?php
namespace app\index\controller;

use think\exception\ValidateException;
use app\model\ServiceTime;

class ServicetimeController extends Base
{

    public function index() {
        $data = ServiceTime::where(['weid' => weid()])
                ->order('id asc,sort asc')
                ->select()
                ->toArray();

        foreach ($data as &$vo) {
            $vo['time'] =$vo['beginTime'];
            $vo['seltime'] =$vo['beginTime'] .'-'. $vo['endTime'];
        }
        return $this->json(['data' => $data]);
    }
}
